import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'connect_type.dart';
import 'esc_command.dart';
import 'flutter_xprinter.dart';
import 'flutter_xprinter_method_channel.dart';

abstract class FlutterXprinterPlatform extends PlatformInterface {
  /// Constructs a FlutterXprinterPlatform.
  FlutterXprinterPlatform() : super(token: _token);

  static final Object _token = Object();

  static FlutterXprinterPlatform _instance = MethodChannelFlutterXprinter();

  /// The default instance of [FlutterXprinterPlatform] to use.
  ///
  /// Defaults to [MethodChannelFlutterXprinter].
  static FlutterXprinterPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [FlutterXprinterPlatform] when
  /// they register themselves.
  static set instance(FlutterXprinterPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  void addMethodCallHandler(CallHandler handler) {
    throw UnimplementedError('addMethodCallHandler() has not been implemented.');
  }


  void scanBluetoothDevices() {
    throw UnimplementedError('scanBluetoothDevices() has not been implemented.');
  }

  void stopDiscovery() {
    throw UnimplementedError('stopDiscovery() has not been implemented.');
  }

  void scanUsbDevices() {
    throw UnimplementedError('scanUsbDevices() has not been implemented.');
  }

  void connect(ConnectType connType, DeviceType deviceType, String address) {
    throw UnimplementedError('connectUSB() has not been implemented.');
  }

  void disconnect(String address) {
    throw UnimplementedError('disconnect() has not been implemented.');
  }

  Future<int> sendPrintTask(List<int> bytes, ConnectType connType, DeviceType deviceType, String address){
    throw UnimplementedError('write() has not been implemented.');
  }

}
